package com.technology.util;

import java.text.DecimalFormat;

public class DecimalFormatUsing {

	public static void main(String[] args) {
		DecimalFormat decimalFormat = new DecimalFormat("#,##0.00");
//		DecimalFormat decimalFormat = new DecimalFormat();
		double number = 25000.75, example = .34;
		int index = 5;
		System.out.println(decimalFormat.format(number));
		System.out.println(decimalFormat.format(example));
		System.out.println(decimalFormat.format(index));
		
		DecimalFormat anotherDecimalFormat = new DecimalFormat("##0.0#");
		System.out.println(anotherDecimalFormat.format(number));
		System.out.println(anotherDecimalFormat.format(example));
		System.out.println(anotherDecimalFormat.format(index));
		
	}

}
